package com.cal.utms.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Embeddable;

@Embeddable
public class UserToMenuId implements Serializable {

	private static final long serialVersionUID = 1L;
	private int menuId;
	private int grpId;

	@Column(name = "MENU_ID", nullable = false)
	public int getMenuId() {
		return menuId;
	}

	public void setMenuId(int menuId) {
		this.menuId = menuId;
	}

	@Column(name = "USER_GROUP_ID", nullable = false)
	public int getGrpId() {
		return grpId;
	}

	public void setGrpId(int grpId) {
		this.grpId = grpId;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof UserToMenuId))
			return false;
		UserToMenuId castOther = (UserToMenuId) other;

		return (this.getGrpId() == castOther.getGrpId()) && (this.getMenuId() == castOther.getMenuId());
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result + (int) this.getGrpId();
		result = 37 * result + (int) this.getMenuId();
		return result;
	}

}
